#include<cstdio>
#include<algorithm>
using namespace std;

int main(){
    //freopen("in.txt","r",stdin);
    int N;
    scanf("%d",&N);
    int inp[N];
    for(int i=0;i<N;i++){
        scanf("%d",&inp[i]);
    }
    sort(inp,inp+N);
    if(N%2==0){printf("0");}
    else{printf("1");}
    int mid=N/2;
    int sum1=0,sum2=0;
    for(int i=0;i<mid;i++){
        sum1+=inp[i];
    }
    for(int i=mid;i<N;i++){
        sum2+=inp[i];
    }
    printf(" %d",abs(sum2-sum1));
}
